package com.combetter.changxing.bindingconfig;

import android.databinding.BindingAdapter;
import android.support.v7.widget.RecyclerView;

import com.combetter.changxing.ui.view.Banner.Banner;

/**
 * Created by Mark.fan on 2018/5/14.
 */

public class BindingRecycleViewConfig {

//    @BindingAdapter({"addOnItemClick"})
//    public static void setOnItemClick(RecyclerView recyclerView, RecyclerViewItemClickSupport.OnItemClickListener listener) {
//        RecyclerViewItemClickSupport.addTo(recyclerView).setOnItemClickListener(listener);
//    }

    @BindingAdapter(value = {"addOnItemClick", "onBannerClickListener"}, requireAll = false)
    public static void addOnItemClick(RecyclerView view, RecyclerViewItemClickSupport.OnItemClickListener listener, Banner.OnBannerClickListener bannerListener) {
        RecyclerViewItemClickSupport.addTo(view).setOnItemClickListener(listener)
                .setOnBannerClickListener(bannerListener);
    }
}
